package thread.simple;

public class DaemonThread extends Thread{
	
	public DaemonThread() {
		setDaemon(true); // Must be called before start()
		start();
	}
	
	@Override
	public void run() {
		while(true) {
			try {
				sleep(100);
			} catch (InterruptedException e) {
				throw new RuntimeException(e);
			}
			System.out.println(this);
		}
	}
	
	public static void main(String[] args) {
		for(int i = 0; i < 5; i++) {
			new DaemonThread();
		}
	}
}
